package com.jianan.mis.sys;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringBeanFactory {

	private static ApplicationContext ctx;

	private SpringBeanFactory() {
	}

	public static void initialize() {
		ctx = new ClassPathXmlApplicationContext(new String[] {
				"config/applicationContext.xml",
				"config/applicationContext-dao.xml",
				"config/applicationContext-service.xml",
				"config/applicationContext-others.xml"});
	}

	public static Object getBean(String beanName) {
		return ctx.getBean(beanName);
	}
}
